<?php
use \yii\helpers\Url;
use \common\components\Toast;

$this->title = '角色列表';
$this->params['breadcrumbs'][] = $this->title;
?>
    <div class="portlet-body">
        <div class="table-toolbar">
            <div class="row">
                <div class="col-md-6">
                    <div class="btn-group">
                        <a data-url="<?=Url::to(['/auth/role'])?>" data-toggle="modal" class="btn sbold green modal-btn"> 添加角色
                            <i class="fa fa-plus"></i>
                        </a>
                    </div>
                </div>
                <div class="col-md-6">
                </div>
            </div>
        </div>

        <table class="table table-striped table-bordered table-hover table-checkable order-column">
            <thead>
            <tr>
                <th> 角色名称 </th>
                <th> 角色描述 </th>
                <th> 操作 </th>
            </tr>
            </thead>
            <tbody>
        <?php foreach($roles as $v){?>
            <tr>
                <td><?=$v->name?></td>
                <td>
                    <?=$v->description?>
                </td>
                <td>
                    <a href="<?=Url::to(['/auth/roleperm','name'=>$v->name])?>" class="btn btn-xs default btn-editable"><i class="fa fa-key"></i> <span>角色权限管理</span></a>
                    <a href="<?=Url::to(['/auth/delete','action'=>'role','name'=>$v->name])?>" class="btn btn-xs default btn-delete"><i class="glyphicon glyphicon-trash"></i> <span>删除</span></a>
                </td>
            </tr>
        <?php }?>
            </tbody>
        </table>
    </div>
    <div id="ajax-modal" class="modal fade" tabindex="-1"> </div>
    <?=
        $this->registerJsFile('/static/pages/js/list.js', [ 'depends' => 'backend\assets\AppAsset']);
        $this->registerJsFile('/static/pages/js/auth.js', [ 'depends' => 'backend\assets\AppAsset']);
    ?>